Shader "Part2/surfExtrusion"//文件路径好找
//多选材质选中
{
    //顶点 扩张胖乎乎的
    //
	Properties
	{
		_MainTex ("Texture", 2D) = "white" {}
        _Amount ("Extrusion Amount", Range(-0.01,0.01)) = 0
	}
	SubShader
	{
		Tags { "RenderType"="Opaque" }
		LOD 100
		Pass
		{
			CGPROGRAM
			// #pragma vertex vert 
			// #pragma fragment frag
			// #include "UnityCG.cginc"

			#pragma surface surf Lambert vertex:vert //光照模型 顶点函数

			struct Input //自带的顶点数据
			{
				float4 vertex : COLOR;
                //一个模型最多传入8个纹理坐标
				float2 uv_MainTex;
                float worldPos;
			}

            //自己传进来的 声明类型
            sampler2D _MainTex;
            float _Amount;

			void vert(inout appdata_full v){
				//往自身方向扩张距离，像气球一样
                v.vertex.xyz += v.vertex.xyz + v.normal * _Amount;
            }
            void surf (Input IN, inout SurfaceOutput o){
                // o.Albedo =1;
                o.Albedo = tex2D(_MainTex,IN.uv_MainTex);
            }

			// object -> world = 100倍
          

		}
	}
}